// index.js
import { formatNumber } from '../../utils/util.js'
import request from '../../utils/request'

Page({
  data: {
    payments: []
  },
  async onShow() {
    const data = await request.get('/mvs/payment/list', { page: 1, limit: 100 })
    this.setData({
      payments: data.page.list.map(item => ({
        ...item,
        paymentMoney: formatNumber(item.paymentMoney) + ' 元',
      }))
    })
  },

  clickHanle(e) {
    wx.navigateTo({
      url: `/pages/paymentLog/index?paymentId=${e.currentTarget.dataset.id}`
    })
  }
})
